function Animal(category) {
    this.category = category
}
Animal.prototype.belong = function () {
    console.log('属于:' + this.category);
}
Animal.prototype.eat = function () {
    console.log(this.category + '会吃东西');
}

function Panda(height,weight,category){
    Animal.call(this,category)
    this.height=height
    this.weight=weight
}

// Panda.prototype=new Animal()
// Panda.prototype.constructor=Panda

// let obj=Object.create(Animal.prototype)
// Panda.prototype=obj
// Panda.prototype.constructor=Panda

// let Temp=function(){}
// Temp.prototype=Animal.prototype
// Panda.prototype=new Temp()
// Panda.prototype.constructor=Panda
Object.setPrototypeOf(Panda.prototype,Animal.prototype)




const panda=new Panda('1.05m','80kg','熊猫')
console.log(panda);
console.log(panda.eat);
console.log(panda.constructor);


